<?php
include_once(PATH_APP_COMMON . "AuthManager.php");
class Controller_AdminExpertsDynamic extends Controller_AdminList  {
	
	protected $_tplForEdit = 'ExpertsDynamic_Create';
	
	protected function _setIndexCondition(&$conditions,&$message){
		
		$search = _gp("search","array");
	
		if($search['expert']){
			$data = M('Experts')->select('uid',"where `name` like '%{$search['expert']}%'");
			$uid = array(0);
			foreach ($data as $value){
				$uid[] = $value['uid'];
			}
			$uid_list = join(" ",$uid);
			
		}
		
		$like = array(
			"subject" => $search['subject'],
		);
		
		$exact = array(
			"uid" =>  $uid_list,
		);
		
		$this->assign("search",$search);

		$conditions = $this->phaseConditions($like,$exact,$date,$range);
		

		!empty($conditions) && $message = "搜索结果:";
	}
}
